package com.xiaozhi.dao;



import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.xiaozhi.entity.DevicePic;

public interface DevicePicMapper {
    @Insert({"INSERT INTO devicePic (deviceId,openId,listenPicName,listenPicUrl,talkPicName,talkPicUrl,descs,createTime,updateTime,convertListenPic,convertTalkPic)",
     "values (#{deviceId},#{openId},#{listenPicName},#{listenPicUrl}, #{talkPicName},#{talkPicUrl},#{descs},#{createTime},#{updateTime},#{convertListenPic},#{convertTalkPic}) "})
    //@Options(useGeneratedKeys = true, keyProperty = "id")
    int add(DevicePic pic);

    @Select("select * from devicePic where deviceId = #{DeviceId}")
    DevicePic selectPicByDeviceId(String DeviceId);

    @Update({"update devicePic set openId=#{openId},listenPicName=#{listenPicName},listenPicUrl=#{listenPicUrl},",
            "talkPicName=#{talkPicName},talkPicUrl=#{talkPicUrl},convertListenPic=#{convertListenPic},convertTalkPic=#{convertTalkPic}",
            "where deviceId=#{deviceId}"} )
    int update(DevicePic pic);
}
